home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Draw / Sources / BoundShp.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  2.6 KB  |  97 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                BoundShp.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef BOUNDSHP_H
  13. #define BOUNDSHP_H
  14.  
  15. #ifndef CONSTANT_H
  16. #include "Constant.h"
  17. #endif
  18.  
  19. #ifndef BASESHP_H
  20. #include "BaseShp.h"
  21. #endif
  22.  
  23. // ----- OS Layer -----
  24.  
  25. #ifndef FWPOINT_H
  26. #include "FWPoint.h"
  27. #endif
  28.  
  29. #ifndef FWRECT_H
  30. #include "FWRect.h"
  31. #endif
  32.  
  33. // ----- Foundation Layer -----
  34.  
  35. #ifndef FWRUNTYP_H
  36. #include "FWRunTyp.h"
  37. #endif
  38.  
  39. //========================================================================================
  40. // class CBoundedShape
  41. //========================================================================================
  42.  
  43. class CBoundedShape : public CBaseShape
  44. {
  45. public:
  46.     FW_DECLARE_CLASS
  47.     FW_DECLARE_AUTO(CBoundedShape)
  48.  
  49. protected:
  50.     CBoundedShape(CDrawPart* drawPart, unsigned short shapeType, unsigned short renderVerb);
  51.     CBoundedShape(CDrawPart* drawPart, FW_CReadableStream& archive);
  52.  
  53. public:
  54.     virtual ~CBoundedShape();
  55.  
  56. public:
  57.     // ----- Geometry
  58.     virtual void        SetShapeGeometry(const FW_CPoint& anchorPoint,  const FW_CPoint& currentPoint);
  59.     virtual FW_CRect    GetRectGeometry() const;
  60.     void                SetRectGeometry(const FW_CRect& bounds);
  61.         
  62.     // ----- Dragging
  63.     virtual void        OffsetShape(Environment *ev, FW_Fixed xDelta, FW_Fixed yDelta);
  64.  
  65.     // ----- Resize
  66.     virtual void        ResizeFeedback(FW_CGraphicContext& gc, const FW_CInk& ink, const FW_CStyle& style, 
  67.                                         short whichHandle, const FW_CPoint& mouseLoc);
  68.     virtual void        GetMapRects(short whichHandle, const FW_CPoint& lastLocation,
  69.                                     FW_CRect& srcRect, FW_CRect& dstRect);
  70.     virtual void        GetHandleCenter(short whichHandle, FW_CPoint& center) const;
  71.     virtual void        MapShape(Environment *ev, const FW_CRect& srcRect, const FW_CRect& dstRect);
  72.  
  73.     // ----- Persistence
  74.     virtual void         Flatten(FW_CWritableStream& archive);
  75.     
  76.     // ----- Scripting
  77.     virtual FW_Boolean    HasProperty(ODDescType whichProperty) const;
  78.     virtual    FW_Boolean    GetProperty(Environment* ev,
  79.                                     FW_CPart* part,
  80.                                     FW_CDesc& propertyValue,
  81.                                     ODDescType whichProperty,
  82.                                     ODDescType desiredType) const;
  83.     virtual void        SetProperty(Environment* ev,
  84.                                     FW_CPart* part,
  85.                                     FW_CDesc& propertyValue,
  86.                                     ODDescType whichProperty);
  87.  
  88.  
  89. private:
  90.     virtual void         OutlineShape(FW_CGraphicContext& gc, const FW_CInk& ink, const FW_CStyle& style, const FW_CRect& rect) = 0;
  91.  
  92. private:
  93.     FW_CRect            fRect;
  94. };
  95.  
  96. #endif
  97.